@extends('backend::layout')

@section('title', '班级列表')

@section('content')
    <div class="card border-no">
        <div class="card-body">
            <h4 class="text-black f-20"></h4>
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">{{ __('code') }}</th>
                        <th scope="col">班级</th>
                        <th scope="col">年级</th>
                        <th scope="col">部</th>
                        <th scope="col">{{ __('Options') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if(isset($list))
                        @foreach($list as $idx => $item)
                            <tr>
                                <th scope="row">{{ $idx + 1 }}</th>
                                <td>{{ $item->c_code }}</td>
                                <td>{{ $item->name }}</td>
                                <td>{{ $item->g_code."年级" }}</td>
                                <td>{{ $item->type == 1 ? "初中" : "高中" }}</td>
                                <td>
                                    @if($currentAdmin->allow('classTeacher/add'))
                                        <a href="{{ route('admin.classTeacher.add', ['id' => $item->id]) }}" class="text-info" title="添加班主任">&nbsp;&nbsp;<i class="fa fa-eye"></i>添加班主任</a>
                                    @endif
                                </td>
                            </tr>
                        @endforeach
                    @endif
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12 col-sm-12 col-xs-12 pull-right">
                    @if(isset($list))
                        {{ $list->links() }}
                    @endif
                </div>
            </div>
        </div>
    </div>
@stop